/*
 * Copyright (c) 2006-2018, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2018-05-17     armink       the first version
 */

#ifndef _FAL_CFG_H_
#define _FAL_CFG_H_

#include <stdio.h>

#define FAL_DEBUG                       1
#define FAL_USING_SUFD                  1
#define FAL_DEV_NAME_MAX                24
#define FAL_DEV_BLK_MAX                 6

#define FAL_USING_NOR_FLASH_DEV_NAME    "norflash0"
#define FAL_PART_HAS_TABLE_CFG          1


#ifndef  FAL_PART_HAS_TABLE_CFG
#define FAL_MALLOC      malloc
#define FAL_CALLOC      calloc
#define FAL_REALLOC     realloc
#define FAL_FREE        free
#endif

/* ===================== Flash device Configuration ========================= */
extern struct fal_flash_dev sfud_nor_flash0;


/* flash device table */
#define FAL_FLASH_DEV_TABLE                                          \
{                                                                    \
    &sfud_nor_flash0,                                                \
}
/* ====================== Partition Configuration ========================== */
#ifdef FAL_PART_HAS_TABLE_CFG
/* partition table */
#define FAL_PART_TABLE                                                               \
{                                                                                    \
    {FAL_PART_MAGIC_WORD,     "Flash", FAL_USING_NOR_FLASH_DEV_NAME,           0,   1024*1024, 0}, \
    {FAL_PART_MAGIC_WORD,  "Download", FAL_USING_NOR_FLASH_DEV_NAME,   1024*1024,   1024*1024, 0}, \
    {FAL_PART_MAGIC_WORD,  "DataSave", FAL_USING_NOR_FLASH_DEV_NAME, 2*1024*1024, 2*1024*1024, 0}, \
}
#endif /* FAL_PART_HAS_TABLE_CFG */

#endif /* _FAL_CFG_H_ */


